package com.scgk.sync.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.scgk.sync.common.constant.SFTPConstants;
import com.scgk.sync.common.utils.SftpClientUtil;
import com.scgk.sync.doamin.Flow;
import com.scgk.sync.mapper.FlowMapper;
import com.scgk.sync.service.IFlowService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ws
 * @since 2024-01-21
 */
@Service
public class FlowServiceImpl extends ServiceImpl<FlowMapper, Flow> implements IFlowService {


    @Override
    public Flow getSftpDataIO(String fileName, String folderName) throws Exception {
        SftpClientUtil instans = SftpClientUtil.getInstans("127.0.0.1", "test", "test", 22, "UTF-8");
        byte[] content = instans.getSftpDataIO(SFTPConstants.REMOTEPATH, folderName, fileName);
        Flow flow = new Flow();
        flow.setContent(content);
        return flow;
    }
}
